using Abp.Application.Services.Dto;
using Abp.AspNetCore.Mvc.Controllers;
using Batman.Cms.Services;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;

namespace Batman.Cms.Controllers
{
    public class HomeController : AbpController
    {
        public ArticleAppSvc ArticleAppSvc { get; set; }

        private readonly IHostingEnvironment _env;

        public HomeController(IHostingEnvironment env)
        {
            _env = env;
        }

        public ActionResult Index(PagedResultRequestDto page)
        {
            var model = ArticleAppSvc.GetArticles(page);
            ViewBag.EnvName = _env.EnvironmentName;
            return View(model);
        }
    }
}
